{include file="common/top" /}
<style>
html{
	background: #ffffff;
}
</style>
<form class="layui-form " action="" style="    background: #fff;">
	<div class="layui-form-item">
		<label class="layui-form-label">媒介人员：</label>
		<div class="layui-col-xs4">
			<select name="user_id" lay-verify="required" lay-search=""  lay-verify="required" autocomplete="off">
				<option value="">直接选择或搜索选择</option>
				{volist name="user_list" id='u'}
					<option value="{$u.id}" {eq name="rs.user_id" value="$u.id"}selected{/eq}>{$u.username}</option>
				{/volist}
	        </select>
		</div>
		<label class="layui-form-label">客户姓名：</label>
		<div class="layui-col-xs4">
			<input type="text" name="name" value="{$rs.name}" lay-verify="required" autocomplete="off" placeholder="请输入客户姓名" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">微信号：</label>
        <div class="layui-col-xs4">
            <input type="text" name="wechat" value="{$rs.wechat}"  autocomplete="off" placeholder="请输入客户微信号" class="layui-input">
        </div>
		<label class="layui-form-label">手机号：</label>
		<div class="layui-col-xs4">
			<input type="number" name="mobile" value="{$rs.mobile}"  autocomplete="off" placeholder="请输入客户手机号" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">银行卡号：</label>
		<div class="layui-col-xs4">
			<input type="text" name="card_number" value="{$rs.card_number}" autocomplete="off" placeholder="请输入银行卡号" class="layui-input">
		</div>
		<label class="layui-form-label">开户行地址：</label>
		<div class="layui-col-xs4">
			<input type="text" name="bank_name" value="{$rs.bank_name}"  autocomplete="off" placeholder="请输入开户行地址" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">支付宝账号：</label>
		<div class="layui-col-xs4">
			<input type="text" name="zfb_num" value="{$rs.zfb_num}"  autocomplete="off" placeholder="请输入支付宝账号" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">备注：</label>
		<div class="layui-col-xs8">
			<textarea name="note"  autocomplete="off" placeholder="请输入客户详细备注" class="layui-textarea">{$rs.note}</textarea>
		</div>
	</div>
	
	<hr />
	<div class="layui-form-item">
		<div class="layui-input-block">
			<input type="hidden" name="id" value="{$rs.id}"  >
			<button class="layui-btn"  lay-submit="" lay-filter="demo1">修改</button>
		</div>
	</div>
	
</form>
{include file="common/footer" /}
<script>
	layui.use(['form', 'layedit', 'laydate'], function(){
		  var form = layui.form ,layer = layui.layer;
		  
		  //监听提交
		  form.on('submit(demo1)', function(data){
			var articleFrom = data.field;
			layer.load(1, { shade : [ 0.5, '#676a6c' ] }); 
			$.post("{:url('save_customer')}?t=json",articleFrom,function(data){
				layer.closeAll();
				if (data['code'] == 1) { 
					var index1 = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index1); //再执行关闭 
					//父页面数据 ，重新加载
					parent.get_s(data['msg']);

				} else {
					layer.msg(data['msg'], { icon : 5 });
				}
			});
			
			return false;
		  });
		 
		});
	
</script>
